<?php

class ChofersController extends AppController {

    var $name = 'Chofers';
    var $layout = "ajax";
    var $components = array('Interfaz', 'Vista',);
    var $helpers = array('Interfaz', 'Vista', 'Ayuda',);
    var $uses = array('Chofer');

    public function beforeFilter() {
        $this->validar();
    }

    public function buscar_cedrif($cedrif = null) {
        $resultado = null;
        $cedrif = $this->Interfaz->mayuscula($cedrif);
        if (!empty($cedrif))
            $resultado = $this->Chofer->find('first', array('conditions' => array('Chofer.estatus' => 1, 'Chofer.ced_rif' => $cedrif)));
        $this->set('data', $resultado);
    }

}
